package org.example.pmsystem;

import lombok.Data;
import org.example.pmsystem.entity.Attend;

import java.util.List;

@Data
public class Response <T>{
    private T data;
    private boolean success;
    private String errMsg;
    public static <K> Response<K> newSuccess(K data){
        Response<K> response=new Response<>();
        response.setData(data);
        response.setSuccess(true);
        return response;
    }
    public static Response<Boolean> newFail(String errMsg){
        Response<Boolean> response=new Response<>();
        response.setErrMsg(errMsg);
        response.setSuccess(false);
        return response;
    }

//    public static Response<Attend> newSuccess(List<Attend> attends) {
//        return null;
//    }
}
